[#--打印对象--]
[#--<#macro dump object><#if object??><#if object?is_string>"${object!}"<#elseif object?is_number>${object}<#elseif object?is_boolean>${object?string('true','false')}<#elseif object?is_date_like>"<#if object?is_datetime>${object?datetime}<#elseif object?is_date_only>${object?date}<#elseif object?is_time>${object?time}[/#if>"<#elseif object?is_hash_ex>{<#list object?keys as k>"${k}":<@dump object[k]/><#if k?has_next>,</#if></#list>}<#elseif object?is_enumerable>[<#list object as o><@dump o/><#if o?has_next>,</#if></#list>]</#if></#if></#macro]--]
[#--service对象初始化--]
[#macro initService]
<script type="text/javascript">
    var service = longController.createService('${base}${ckey}');
    //S.page.size=3;
    LC.attach('${ckey}', service);
    $(document).ready(function (e) {
        LC.initToolbar({
            'new': LC.S.tools.toolNew,
            'detail': LC.S.tools.toolDetail,
            'remove': LC.S.tools.toolRemove,
            'flesh': LC.S.tools.toolFlesh
        });
        LC.S.fillQueryForm();
        LC.S.query();
    });
    LC.S.config = ${config!"{}"}
</script>
[/#macro]
[#--树型service对象初始化--]
[#macro initTreeService]
<script type="text/javascript">
    var service = longController.createTreeService('${base}${ckey}');
    //S.page.size=3;
    LC.attach('${ckey}', service);
    $(document).ready(function (e) {
        LC.S.fleshTree();
    });
</script>
[/#macro]
[#--分页信息--]
[#macro page page currentPageSize]
<div class="page">
    <span class="pageleft">
        每页<input type="number" name="page.size" value="${page.size}" id="pageSize"
                 onChange="LC.S.page.changeSize(this.value)"
                 min="5" max="100"/>条&nbsp;
        页次<span>${page.index}</span>/<span>${page.count}</span>&nbsp;
        共计<span>${page.sum}</span>条&nbsp;
        [#if currentPageSize??]本页<span>${currentPageSize}</span>条[/#if]
    </span>
    <span class="pageright">
        <a href="javascript:LC.goFirst()">首页</a>
        <a href="javascript:LC.goPrev()">上一页</a>
        <a href="javascript:LC.goNext()">下一页</a>
        <a href="javascript:LC.goEnd()">尾页</a>
        跳到<select id="pageIndex" onchange="LC.go(this.value)">
        [#list 1..page.count as n]
            <option value="${n}">${n}</option>
        [/#list]
    </select>页
    </span>
</div>
<script type="text/javascript">
    LC.setPage({
        count:${page.count!0},
        index: ${page.index!1},
        size:${page.size!20},
        sum:${page.sum!0}
    });
    $('#pageIndex').val(${page.index});
</script>
[/#macro]

[#--工具栏--]
[#macro toolbar]
<div class="toolbar"></div>
[/#macro]

[#macro select name null data text="text" value="value" params...]
<select name="${name}"[#list params?keys as key] ${key}="${params[key]}"[/#list]>
    [#if null??]
    <option value="">${null}</option>
    [/#if]
    [#list data as d]
    <option value="${d[value]}" [#if init?? && key == init]selected="selected"[/#if]>${d[text]}</option>
    [/#list]
</select>
[/#macro]
[#--字典下拉框--]
[#macro dselect name null id text="text" value="value" init="" params...]
<select name="${name}"[#list params?keys as key] ${key}="${params[key]}"[/#list]>
    [#if null??]
    <option value="">${null}</option>
    [/#if]
    [#assign _dict=_dictionary[id] /]
    [#list _dict?keys as key]
    <option value="${key}" [#if init?has_content && key == init]selected="selected"[/#if]>${_dict[key]}</option>
    [/#list]
</select>
[/#macro]
[#macro selectText data selected text="text" value="value" ]
<select name="type" class="selectmenu">
    [#list data as d]
        [#if d[value]==selected]${d[text]}[/#if]
    [/#list]
</select>
[/#macro]